package eo.builder.util;

/**
 * Defines an operation to be performed while iterating through, for example, a
 * container. Tries to makes up for the lack of closures in java.
 * 
 * @author takeshi
 * 
 * @param <E>
 *            the iteration element type
 */
public interface IterationStep<E> {

	/**
	 * Called for every step of the iteration. If the returned value is
	 * <code>false</code>, iteration is stoped.
	 * 
	 * @param e
	 *            the iteration element
	 * @return boolean that indicates wheter or not to keep iterating
	 */
	boolean nextIteration(E e);

}
